import request from '@/utils/request'

// 创建角色授权
export function createAuthorize(data) {
  return request({
    url: '/sa/authorize/create',
    method: 'post',
    data: data
  })
}

// 角色授权 排除
export function excludedAuthorize(roleId, orgFullId) {
  let data = {
    roleId: roleId,
    orgFullId: orgFullId
  }
  return request({
    url: '/sa/authorize-exclude/create',
    method: 'post',
    data: data
  })
}
// 角色授权 排除
export function cancelExcludedAuthorize(roleId, orgFullId) {
  let data = {
    roleId: roleId,
    orgFullId: orgFullId
  }
  return request({
    url: '/sa/authorize-exclude/cancel',
    method: 'post',
    data: data
  })
}

// 更新角色授权
export function updateAuthorize(data) {
  return request({
    url: '/sa/authorize/update',
    method: 'put',
    data: data
  })
}

// 删除角色授权
export function deleteAuthorize(id) {
  return request({
    url: '/sa/authorize/delete?id=' + id,
    method: 'delete'
  })
}

// 获得角色授权
export function getAuthorize(id) {
  return request({
    url: '/sa/authorize/get?id=' + id,
    method: 'get'
  })
}

// 获得角色授权 分页
export function getAuthorizePage(query) {
  return request({
    url: '/sa/authorize/page',
    method: 'get',
    params: query
  })
}

// 导出角色授权  Excel
export function exportAuthorizeExcel(query) {
  return request({
    url: '/sa/authorize/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
